<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//Ddiv HTML 4.01 divansitional//EN" "http://www.w3.org/div/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/goals.css" rel="stylesheet">
  <title>人马君</title>
</head>
<body>
  <body>
    <div class="page-group">
      <div class="page page-current">
        <header class="bar bar-nav fs-header-small">
          <a href="${ctx.host}/rounds/${courseRound.id}/courseware/home" class="icon icon-left pull-left"></a>
          <h1 class="title" style="font-weight: bold;">课程</h1>
          <a href="javascript:void(0);" class="button button-link pull-right edit-button"><span style="font-size: .7rem;">删除</span></a>
        </header>
        
        <nav class="bar bar-tab" style="padding: 0 .5rem;">
          <div class="tab-item external">
            <c:if test="${session > 1}">
              <a href="${ctx.host}/rounds/${courseRoundId}/course-coursewares?session=${session-1}" style="color: #929292">
                <span class="icon icon-left" style="font-size: .7rem;"></span>
                <span class="tab-label" style="font-size: .7rem;">上一节</span>
              </a>
            </c:if>
          </div>
          
          <div class="tab-item external" style="width: 5%;">
            <c:if test="${!generated}">
              <a href="javascript:void(0);" style="width: 100%;">
                <button class="button button-light batch-link" style="width: 100%; position: static; height: 1.5rem; line-height: 1.5rem; background: #FEDC32; color: #555;">发送课件</button>
              </a>
            </c:if>
          </div>
          <div class="tab-item external">
            <c:if test="${session < courseRound.fitnessGroup.hours}">
              <a href="${ctx.host}/rounds/${courseRoundId}/course-coursewares?session=${session+1}" style="color: #929292">
                <span class="icon icon-right" style="font-size: .7rem;"></span>
                <span class="tab-label" style="font-size: .7rem;">下一节</span>
              </a>
            </c:if>
          </div>
        </nav>
        
        <div class="content">
          <div class="content-block no-margin text-center" style="padding: .5rem .75rem; background: #ffde00;">
            <p style="margin: .25rem 0 0; font-size: 1rem; color: #333;">Session ${session}</p>
          </div>
        <form name="delete_form" action="">
          <input type="hidden" name="_method" value="DELETE">
          <div class="content-block course-target-course target-course" style="padding: 0; margin: 0">
            <div class="basic-item flex-box basic-header">
              <div class="item" style="width: 30%;flex: none;">动作</div>
              <div class="item" style="width: 10%;flex: none;">组数</div>
              <div class="item" style="width: 20%;flex: none;">每组次数</div>
              <div class="item" style="width: 20%;flex: none;">最大重量</div>
              <div class="item" style="width: 10%;flex: none;">计时</div>
              <div class="item" style="width: 10%;flex: none;"></div>
            </div>
            <c:forEach var="courseware" items="${coursewares}">
              <div class="basic-item flex-box">
                <label class="delete-movement">
                  <input type="checkbox" name="coursewareId" value="${courseware.id}"/>
                </label>
                <div class="item flex-shrink" style="width: 30%;flex: none;">
                  <a href="${ctx.host}/rounds/${courseRound.id}/course-coursewares/${courseCoursewareId}/coursewares/${courseware.id}/edit" class="movement-alink">${courseware.movement.name}</a>
                </div>
                <div class="item" style="width: 10%;flex: none;"><span class="big-size">${courseware.groupAmount}</span></div>
                <div class="item" style="width: 20%;flex: none;"><span class="big-size">${courseware.movementNumber}</span></div>
                <div class="item" style="width: 20%;flex: none;"><span class="big-size">${courseware.maxWeight}</span></div>
                <div class="item" style="width: 10%;flex: none;"><span class="big-size">${courseware.time}</span></div>
                <a class="item" style="width: 10%;flex: none;color: #929292" href="${ctx.host}/rounds/${courseRound.id}/course-coursewares/${courseCoursewareId}/coursewares/${courseware.id}"><span class="icon icon-right"></span></a>
              </div>
            </c:forEach>
          </div>
          </form>
          
          <div class="row delete-box">
            <div class="col-50" style="margin-left: .25rem;">
              <label>
                <input type="checkbox" name="" class="all-select"> 全选
              </label>
            </div>
            <div class="col-50">
              <a href="javascript:void(0);" class="button button-fill delete-button">删除动作</a>
            </div>
          </div>
          
          <div class="row add-action-box" style="padding:0 .5rem;">
            <div class="col-50">
              <a href="${ctx.host}/rounds/${courseRound.id}/course-coursewares/${courseCoursewareId}/coursewares/add" class="button button-fill add-group">添加动作</a>
            </div>
            <div class="col-50">
              <a href="#group-btn" class="button button-fill add-group" data-toggle="push">添加动作组</a>
              <%-- <a href="${ctx.host}/rounds/${courseRound.id}/course-courseware/dailyCourseware/${courseCoursewareId}/modify" class="button button-fill add-group">添加动作组</a> --%>
            </div>
          </div>
          
        </div>
      </div>
    </div>
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource root="${ctx.resource}/build" type="script" src="js/page/courseware/course-courseware-edit.js" />
    <script type="text/javascript">
      require(['page/courseware/course-courseware-edit'], function(page) {
        page.init({
            'roundId': '${courseRound.id}',
            'batchId': '${batchId}',
            'courseCoursewareId': '${courseCoursewareId}',
            'session': '${session}',
            'groups': JSON.parse('${persist.fitnessGroups}')
        });
      })
    </script>
  </body>
</html>
